package cn.yeziji.forum.common.key.generate;

import cn.yeziji.forum.common.key.UserCacheKey;

/**
 * 生成用户缓存键值方法
 *
 * @author gzkemays
 * @since 2022/6/25 10:31
 */
public class UserCacheKeyGenerate implements UserCacheKey {
  @Override
  public String getRefreshTokenKey(String key) {
    return UserCacheKey.USER_TOKEN_CACHE + "New::" + key;
  }

  @Override
  public String getTokenCacheKey(String token) {
    return UserCacheKey.USER_TOKEN_CACHE + token;
  }

  @Override
  public String getSecondaryTokenKey(String username) {
    return UserCacheKey.SECONDARY_TOKEN_CACHE + username;
  }
}
